# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gemname=jekyll-sass-converter
pkgname=ruby-${_gemname}
pkgver=2.2.0
pkgrel=1
pkgdesc='Sass converter for Jekyll'
url='https://github.com/jekyll/jekyll-sass-converter'
arch=('any')
license=('MIT')
depends=('ruby' 'ruby-rdoc' 'ruby-sassc')
options=('!emptydirs')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/jekyll/jekyll-sass-converter/archive/v${pkgver}.tar.gz)
sha512sums=('2704defb5ded854afb3620e876045e222e3f4bf03344f9a060fcfc0b1f2e6bebfef776aff69e592ba8484516060d4c5a75499fc343fcab5f9c96cc2f6658f344')

prepare() {
  cd ${_gemname}-${pkgver}
  sed -r 's|~>|>=|g' -i ${_gemname}.gemspec # don't give a fuck about rubys bla bla
  sed 's|git ls-files -z|find -type f -print0\|sed "s,\\\\./,,g"|' -i ${_gemname}.gemspec
}

build() {
  cd ${_gemname}-${pkgver}
  gem build ${_gemname}.gemspec
}

package() {
  cd ${_gemname}-${pkgver}
  local _gemdir="$(gem env gemdir)"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" -n "${pkgdir}/usr/bin" ${_gemname}-${pkgver}.gem
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
  rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
}

# vim: ts=2 sw=2 et:
